Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development


Client cache

As a Progress Dynamics run-time client or WebClient session runs, object descriptions are cached on the client in temp-tables. The data in these tables is then accessed by the drivers, such as the dynamic window procedure rydyncontw.w that realize the client portion of the application at run time.

This section summarizes the temp-tables that make up the client cache.

Cache_Object table

This temp-table contains information about master object records as well as contained instances. This table contains information about the static (physical) object required to instantiate a dynamic object, the logical object name and other data, such as the result code, run attribute, etc. There can only be one record in the cache for any given master object (and thus for its contained instances) at any given time. This table is (roughly) a combination of the information from the ryc_smartobject and ryc_object_instance Repository tables.

The cache_Object table is joined to records in the next four tables, cache_ObjectPage, cache_ObjectLink, cache_ObjectPageInstance, and cache_ObjectUIEvent, using the key field tRecordIdentifier.

The following code sample shows a slightly simplified definition of the cache_Object temp-table (without formats and indexes). All the cache temp-tables are defined in the include file ry/app/ryobjretri.i, as shown:

DEFINE TEMP-TABLE cache_Object 
    FIELD tLogicalObjectName            AS CHARACTER /* Logical Object Name */ 
    FIELD tUserObj                      AS DECIMAL   /* User object ID */ 
    FIELD tResultCode                   AS CHARACTER /* set of result codes */ 
    FIELD tRunAttribute                 AS CHARACTER /* Run Attribute */ 
    FIELD tLanguageObj                  AS DECIMAL   /* Language object ID */ 
    FIELD tRecordIdentifier             AS DECIMAL   /* Instance Id key field */ 
    FIELD tContainerRecordIdentifier    AS DECIMAL   /* Container Record Id */        
    FIELD tMasterRecordIdentifier       AS DECIMAL   /* Master Record Id */ 
    FIELD tClassName                    AS CHARACTER /* Class Name */ 
    FIELD tClassTableName               AS CHARACTER /* Class Table Name */ 
    FIELD tClassBufferHandle            AS HANDLE    /* Class Attr Buffer Handle*/ 
    FIELD tContainerObjectName          AS CHARACTER /* Container Name */ 
    FIELD tInstanceIsAContainer         AS LOGICAL   /* Is this a Container? */ 
    FIELD tObjectPathedFilename         AS CHARACTER /* Pathed Filename */ 
    FIELD tObjectInstanceHandle         AS HANDLE    /* Object Instance handle */ 
    FIELD tObjectInstanceObj            AS DECIMAL /* Object Instance ObjectID*/ 
    FIELD tObjectInstanceName           AS CHARACTER /* Object Instance Name */ 
    FIELD tObjectInstanceDescription    AS CHARACTER /* Instance Description */ 
    FIELD tDbAware                      AS LOGICAL   /* Is Object DB Aware? */ 
    FIELD tLayoutPosition               AS CHARACTER /* Layout Position */ 
    FIELD tCustomSuperProcedure         AS CHARACTER /* Super Procedure */ 
    FIELD tCustomSuperHandle            AS HANDLE    /* Super Proc. Handle */ 
    FIELD tDestroyCustomSuper           AS LOGICAL   /* Destroy Super on exit? */ 
    FIELD tInstanceOrder                AS INTEGER   /* Instance Order */ 
    FIELD tPageNumber                   AS INTEGER   /* Page Number */ 
    FIELD tSmartObjectObj               AS DECIMAL   /* Smartobject object ID */ 
    FIELD tSdoSmartObjectObj            AS DECIMAL   /* SDO object ID if any */        
    FIELD tSdoPathedFilename            AS CHARACTER /* SDO Pathed Filename */ 
    FIELD tInheritsFromClasses          AS CHARACTER /* Class list */  

A few fields merit additional explanation:

Cache_ObjectPage table

This temp-table contains information about pages within a container. It uses the information in the Repository database table ryc_page. This is the temp-table definition for this table:

DEFINE TEMP-TABLE cache_ObjectPage  
    FIELD tRecordIdentifier         AS DECIMAL   /* Record Identifier key field 
*/ 
    FIELD tPageNumber               AS INTEGER   /* Page Number */ 
    FIELD tPageLabel                AS CHARACTER /* Page Label */ 
    FIELD tLayoutCode               AS CHARACTER /* Layout Code */ 
    FIELD tPageInitialized          AS LOGICAL   /* Is the Page Initialized? */ 
    FIELD tPageObj                  AS DECIMAL   /* Page object ID */ 

The tPageObj object ID is used for finding this record from the page object instance.

Cache_ObjectLink table

The temp-table contains link information derived from this Repository table (ryc_smartlink):

DEFINE TEMP-TABLE cache_ObjectLink                   
    FIELD tRecordIdentifier         AS DECIMAL   /* record Idntifier key field */ 
    FIELD tSourceObjectInstanceObj  AS DECIMAL   /* Link Source object ID */ 
    FIELD tTargetObjectInstanceObj  AS DECIMAL   /* Link Target object ID */ 
    FIELD tLinkName                 AS CHARACTER /* Link Name */ 
    FIELD tLinkCreated              AS LOGICAL   /* Has the link been created? */ 

Cache_ObjectPageInstance table

This temp-table contains information about object instances on a given page derived from the Repository table ryc_page_object. This is the definition of the table:

DEFINE TEMP-TABLE cache_ObjectPageInstance           
    FIELD tRecordIdentifier         AS DECIMAL   /* Record Identifier key */ 
    FIELD tPageNumber               AS INTEGER   /* Page Number */ 
    FIELD tObjectInstanceObj        AS DECIMAL   /* Object Instance object ID */ 
    FIELD tObjectInstanceHandle     AS HANDLE    /* Object Instance Handle */ 
    FIELD tObjectInstanceName       AS CHARACTER /* Object Instance Name */ 
    FIELD tObjectTypeCode           AS CHARACTER /* Class Code */ 
    FIELD tLayoutPosition           AS CHARACTER /* Layout Position */ 

Cache_ObjectUIEvent table

This temp-table contains information about UI events derived from ryc_ui_event:

DEFINE TEMP-TABLE cache_ObjectUiEvent                
    FIELD tClassName                     AS CHARACTER /* Class Name */    
    FIELD tRecordIdentifier              AS DECIMAL        
    FIELD tEventName                     LIKE ryc_ui_event.event_name 
    FIELD tActionType                    LIKE ryc_ui_event.action_type 
    FIELD tActionTarget                  LIKE ryc_ui_event.action_target 
    FIELD tEventAction                   LIKE ryc_ui_event.event_action  
    FIELD tEventParameter                LIKE ryc_ui_event.event_parameter  
    FIELD tEventDisabled                 LIKE ryc_ui_event.event_disabled 

The fields are described below:

Cache_<classname> tables

There is a dynamic temp-table containing attribute information for each defined class or object type in the Repository, with the name class_<classname>. Each of these temp-tables has a field for each attribute defined for the class, whose initial value is the default attribute value defined for the attribute for that class, using the Attribute Value Maintenance and Object Type Maintenance utilities. These temp-tables are dynamic because they are defined at run time based on the set of attributes associated with each class. When you use the framework utilities to add attributes to a class and give them an initial value for the class, it is this information that the framework uses to create the temp-table for each class at run time. In this way attributes can be added to the classes in the framework without the need to define them anywhere in source code or to recompile any procedures in order for them to become a part of all the dynamic objects in that class.

See the "Using the Profile Manager" section for an example of how you can define new attributes and associate them with object types.

ttClass table

This temp-table stores the names of all the classes (object types) and their associated temp-table names, along with the handles to the default buffers of the temp-tables that have been created to store each class’s default attributes. As described above, a separate dynamic temp-table is defined for each class, containing a separate field for every attribute in the class, plus some extra control fields. The table for each class is called cache_ + the class name, for example: cache_dynview.

The ttClass table is updated in the function createClassCacheRecord in the Repository Manager, which is called from the createClassCache procedure, which caches the attribute values for an object type.

Record identifiers

Every cache_Object record has a unique key, called tRecordIdentifier. This DECIMAL value is used as a foreign key to join the object record to other tables. This value is also stored at run time in the object property called InstanceID.

The tContainerRecordIdentifier field in the cache_Object table contains the Record Identifier of the cache_Object record that represents the container object on which the current cache_Object is an instance. This is zero when the cache_Object represents a master object.

The tMasterRecordIdentifier field in the cache_Object table is the Record Identifier of the cache_Object representing the master object of this cache_Object record. This value is the same as the Record Identifier if this cache record represents a master object.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095